import java.util.regex.Matcher;
import java.util.regex.Pattern;

public class E4 {

  /**
   * @param args
   */
  public static void main(String[] args) {
    String[] matching = { "0", "33", "-2381.78132", "4.3347", "12.00", "-0.34"};
    String[] notMatching = { "+3", "--2", "24 543", "01.23", "12.", "11,23", "12е7", ".34"};
    Pattern pattern = Pattern.compile("-?(0|([1-9]\\d*))(\\.\\d+)?");
    for (String number : matching) {
      Matcher matcher = pattern.matcher(number);
      System.out.println(number + " is matching? " + matcher.matches());
    }
    for (String number : notMatching) {
        Matcher matcher = pattern.matcher(number);
        System.out.println(number + " is matching? " + matcher.matches());
      }
  }

}
